import Vue from 'vue';

Vue.filter('formatTel', (tel) => { //手机号中间4位加密
	if (!tel) return '';

	let reg = /^(\d{3})\d{6}(\d{2})$/;

	let newtel = tel.replace(reg, "$1******$2");

	return newtel;

})

Vue.filter('formatIdCard', (num) => { //身份证校验
	if (!num) return '';
	
	const temp = num.substring(1, 17); 
	
	const newIdCard = num.replace(temp, '***********');
	
	return newIdCard;

});